package com.fr.report.web;

import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLReadable;
import com.fr.base.xml.XMLableReader;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Printer
  implements XMLReadable, Serializable, Cloneable
{
  private String[] printers;

  public String[] getPrinters()
  {
    return this.printers;
  }

  public void setPrinters(String[] paramArrayOfString)
  {
    this.printers = paramArrayOfString;
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("ServerPrinter");
    String[] arrayOfString = getPrinters();
    for (int i = 0; (arrayOfString != null) && (i < arrayOfString.length); ++i)
      paramXMLPrintWriter.startTAG("Printer").textNode(arrayOfString[i]).end();
    paramXMLPrintWriter.end();
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if (paramXMLableReader.isChildNode())
    {
      String str2 = paramXMLableReader.getTagName();
      if (str2.equals("Printer"))
      {
        String str1;
        if ((str1 = paramXMLableReader.getElementValue()) != null)
        {
          ArrayList localArrayList = new ArrayList();
          String[] arrayOfString1 = getPrinters();
          for (int i = 0; (arrayOfString1 != null) && (i < arrayOfString1.length); ++i)
            localArrayList.add(arrayOfString1[i]);
          localArrayList.add(str1);
          i = localArrayList.size();
          String[] arrayOfString2 = new String[i];
          for (int j = 0; j < i; ++j)
            arrayOfString2[j] = localArrayList.get(j).toString();
          setPrinters(arrayOfString2);
        }
      }
    }
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    Printer localPrinter = (Printer)super.clone();
    if (this.printers != null)
    {
      localPrinter.printers = new String[this.printers.length];
      System.arraycopy(this.printers, 0, localPrinter.printers, 0, this.printers.length);
    }
    return localPrinter;
  }
}